import type { RouteRecordRaw } from "vue-router";

import { preferences } from "@/config/preference";
import { BasicLayout } from "@/layout";

const fallBackRoutes: RouteRecordRaw[] = [
  {
    path: "/:pathMatch(.*)*",
    // alias: "/404",
    name: preferences.app.notFound,
    component: () => import("@/views/not-found.vue"),
  },
];

const coreRoutes: RouteRecordRaw[] = [
  {
    path: "/",
    name: preferences.app.root,
    component: BasicLayout,
    redirect: { path: preferences.app.home },
    meta: { label: "", componentName: preferences.app.root, cache: true },
    children: [
      // {
      //   path: "system",
      //   component: () => import("@/views/system/index.vue"),
      //   meta: { requiresAuth: true },
      // },
      // {
      //   path: preferences.app.home,
      //   component: () => import("@/views/home/index.vue"),
      //   meta: { requiresAuth: true },
      // },
    ],
  },
  {
    path: preferences.app.login,
    name: "LoginView",
    component: () => import("@/views/login/index.vue"),
    meta: { whitelist: true, componentName: "LoginView", label: "" },
  },
];

export { coreRoutes, fallBackRoutes };
